<template>
	<view class="item-cont margin-bottom">
		<image :src="goodData.img" mode=""></image>
		<view class="flex justify-between align-center">
			<view class="intro">
				<view class="text-md margin-top-sm">
					{{goodData.name}}
				</view>
				<view class="text-xs margin-tb-xs text-cut">
					{{goodData.french}}
				</view>
			</view>
			<view class="cart-btn" @click="handlePopShow">
				<text class="iconfont icon-gouwuche"></text>
			</view>
		</view>
		<view class="text-price">
			{{goodData.price}}
		</view>
	</view>
</template>

<script>
	export default {
		name:"goods-item",
		props: {
			goodData: {
				type: Object,
				require:true
			},
		},
		data() {
			return {
				
			};
		},
		methods: {
			handlePopShow() {
				this.$store.commit('cart/editIdxMut',-1)
				this.$store.commit('cart/popDataMut',this.goodData)
				this.$store.commit('cart/popShowMut',true)
			}
		},
	}
</script>

<style lang="scss">
.item-cont{
	image{
		height: 350upx;
		width: 350upx;
	}
	overflow: hidden;
}
.cart-btn{
	height: 60upx;
	width: 60upx;
	border-radius: 50%;
	background-color: #FEE329;
	text-align: center;
	line-height: 60upx;
	
}
.intro{
	max-width: 50%;
}
</style>